<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0028)http://jdbi.org/archive.html -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>


<title>abacus-common</title>

<script type="text/javascript" src="./css/ga.js"></script>
<script type="text/javascript">
	if (top.location != self.location)
		top.location.replace(self.location);
</script>

<link href="./css/css" rel="stylesheet" type="text/css"></link>
<link href="./css/css(1)" rel="stylesheet" type="text/css"></link>
<link rel="stylesheet" href="./css/syntax.css" type="text/css"></link>
<link rel="stylesheet" href="./css/screen.css" type="text/css"></link>

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-65247258-1', 'auto');
  ga('send', 'pageview');
</script>

</head>
<body>
	<div id="site">
		<h1>
			<a href="./index.html">abacus-common</a> <span id="navigation"> <a href="./docs.html">Docs</a> | <a href="./download.html">Download</a>
				| <a href="./api-docs/index.html">Javadoc</a> | <a href="./faq.html">FAQ</a> | <a href="./community.html">Community</a>
			</span>
		</h1>
	</div>

	<div id="content">

		<div id="page">

			<h1>PrimitiveList</h1>
			<p>
				PrimitiveList implements the functions in <i>List</i> for primitive types: 
				<a href="./BooleanList_view.html">BooleanList</a>, 
				<a href="./CharList_view.html">CharList</a>, 
				<a href="./ByteList_view.html">ByteList</a>, 
				<a href="./ShortList_view.html">ShortList</a>,
				<a href="./IntList_view.html">IntList</a>,
				<a href="./LongList_view.html">LongList</a>,
				<a href="./FloatList_view.html">FloatList</a>,
				<a href="./DoubleList_view.html">DoubleList</a> and  
				<a href="./ObjectList_view.html">ObjectList</a>.
				It's first time for developers to keep efficiency of primitive types while obtain the flexibility provided by Object/Collection/Stream. 
				It becomes incredible easy/convenient to program with primitive array/list or convert among different types. Additionally, Stream/Lambda are fully supported for primitive types. 
				Here is a simple sample:
			</p>

<!-- HTML generated using hilite.me --><div style="background: #f8f8f8; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #AA22FF">@Test</span>
<span style="color: #008000; font-weight: bold">public</span> <span style="color: #B00040">void</span> <span style="color: #0000FF">test_CharList</span><span style="color: #666666">()</span> <span style="color: #666666">{</span>
    CharList charList <span style="color: #666666">=</span> CharList<span style="color: #666666">.</span><span style="color: #7D9029">of</span><span style="color: #666666">(</span><span style="color: #BA2121">&#39;1&#39;</span><span style="color: #666666">,</span> <span style="color: #BA2121">&#39;2&#39;</span><span style="color: #666666">,</span> <span style="color: #BA2121">&#39;3&#39;</span><span style="color: #666666">,</span> <span style="color: #BA2121">&#39;a&#39;</span><span style="color: #666666">,</span> <span style="color: #BA2121">&#39;b&#39;</span><span style="color: #666666">,</span> <span style="color: #BA2121">&#39;c&#39;</span><span style="color: #666666">);</span>
    assertTrue<span style="color: #666666">(</span>charList<span style="color: #666666">.</span><span style="color: #7D9029">contains</span><span style="color: #666666">(</span><span style="color: #BA2121">&#39;b&#39;</span><span style="color: #666666">));</span>

    charList<span style="color: #666666">.</span><span style="color: #7D9029">remove</span><span style="color: #666666">(</span><span style="color: #BA2121">&#39;b&#39;</span><span style="color: #666666">);</span>
    assertFalse<span style="color: #666666">(</span>charList<span style="color: #666666">.</span><span style="color: #7D9029">contains</span><span style="color: #666666">(</span><span style="color: #BA2121">&#39;b&#39;</span><span style="color: #666666">));</span>

    CharList letters <span style="color: #666666">=</span> charList<span style="color: #666666">.</span><span style="color: #7D9029">filter</span><span style="color: #666666">(</span>e <span style="color: #666666">-&gt;</span> e <span style="color: #666666">&gt;=</span> <span style="color: #BA2121">&#39;a&#39;</span><span style="color: #666666">);</span>
    assertEquals<span style="color: #666666">(2,</span> letters<span style="color: #666666">.</span><span style="color: #7D9029">size</span><span style="color: #666666">());</span>
<span style="color: #666666">}</span>
</pre></div>


		</div>

	</div>
</body>

</html>